package cn.fan.springboot_easyexcle.dao;

import cn.fan.springboot_easyexcle.model.DriverbyVehicleExportErrorVo;
import cn.fan.springboot_easyexcle.service.impl.EasyexlReadBaseService;
import com.alibaba.excel.metadata.CellData;
import com.mysql.cj.util.StringUtils;
import org.apache.poi.util.StringUtil;

import java.util.List;
import java.util.Map;

//这个是导入之后的处理业务逻辑的类
public class easyreadDao extends EasyexlReadBaseService {


    @Override
    public void save(List list) {
        for (Object o : list) {
            if (o != null) {
                DriverbyVehicleExportErrorVo driverbyVehicleExportErrorVo = new DriverbyVehicleExportErrorVo();
                driverbyVehicleExportErrorVo = (DriverbyVehicleExportErrorVo) o;
                String remark = "";
                if (StringUtils.isNullOrEmpty(driverbyVehicleExportErrorVo.getIdentityCard())) {
                    remark += "身份证号码不能为空";
                }
                if(!StringUtils.isNullOrEmpty(remark)){
                    addfailandsetremark(o, remark);
                }else{//这边进行保存

                }
            }
        }

    }

  //导入的标题
    @Override
    public String getreportName() {
        return "exl测试名称";
    }
	
	//表头检查
    @Override
    public void checkexlHead(Map<Integer, CellData> headMap) {
        if (headMap != null && headMap.size() > 0) {
            headMap.forEach((p, v) -> {
                System.out.println(v);
            });
        } else {
            setIssave(false);
        }
    }
}
